package yz.cp.back.common.enums;

public enum UserRoleStatus {
    NULL(-1,"N/A"),
    N0(0,"待审核"),
    N1(1,"正常/审核通过"),
    N2(2,"审核被拒"),
    N3(3,"冻结");
    private Integer code;
    private String name;

    UserRoleStatus (int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static UserRoleStatus  getByCode(Integer code){
        for (UserRoleStatus  item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return UserRoleStatus.NULL;
    }
}
